﻿@model IEnumerable<AP.Framework.Infrastructure.Entities.cms_ArticleCategory>
@{
    ViewBag.Title = "文章分类";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}
<ul class="breadcrumb" style="padding-left: 0px; margin-bottom: 10px;">
    <li><a href="@Url.Action("Index", "Default", "Admin")">首页</a> <span class="divider">
        /</span></li>
    <li><a class="active">@ViewBag.Title</a></li>
</ul>
<p>
    <a href="@Url.Action("Add", "ArticleCategory", "Admin")" class="btn btn-primary">添 加</a></p>
<div id="grid">
    @{  var grid = new WebGrid(source: Model, defaultSort: "Code", rowsPerPage: 10, ajaxUpdateContainerId: "grid");    
        @grid.GetHtml(
                               tableStyle: "table table-bordered",
                               headerStyle: "header",
                               alternatingRowStyle: "alt",
                               footerStyle: "foot",
                                columns: grid.Columns(
                                            grid.Column("Name", "名称"),
                                            grid.Column("Description", "描述"),
                                            grid.Column("Sequence", "顺序"),
                                            grid.Column("IsDisable", "是否隐藏/锁定"),
                                            grid.Column("ModifyBy", "创建者"),
                                                       grid.Column("ModifyTime", "时间", format: (item) => item.ModifyTime == null ? "" : item.ModifyTime.ToString("yyyy-MM-dd")),
                                            grid.Column(format: (item) => Html.ActionLink("编辑", "Edit", new { ArticleCategoryId = item.ID }, new { @class = "badge badge-important" })),
                                            grid.Column(format: (item) => Html.ActionLink("删除", "Delete", new { ArticleCategoryId = item.ID }, new { @class = "badge badge-important" }))
                                            ),
                                             fillEmptyRows: !IsPost,
                                             mode: WebGridPagerModes.All,
                                             firstText: "第一页",
                                             previousText: "上一页",
                                             nextText: "下一页",
                                             lastText: "最后一页",
                                             numericLinksCount: 15
                                                        ) 
    }
</div>
